package com.Deome.Class13;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Game {
    public static void main(String[] args) {
        ArrayList<Integer>list=new ArrayList<>();
        Random s=new Random();
        for (int i=0;i<6;i++){
            int red=s.nextInt(33)+1;
            if(list.contains(red)){
                System.out.println("索引为："+i+"的时候，产生了重复号码："+red);
                i--;
            }else {
                list.add(red);
            }
        }
        Collections.sort(list);
        int blue=s.nextInt(16)+1;
        list.add(blue);
        System.out.println(list);
    }

}
